import entity.Equip;
import entity.Player;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    @Test
    public void test1() {
        ApplicationContext context=new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
        Equip lanMoRing=(Equip)context.getBean("lanMoRing");
        Player player=(Player)context.getBean("zhangsan");
        System.out.print("熊静装备：");
        player.updateEquip(lanMoRing);
        System.out.println("速度增效"+player.getRing().getSpeedPlus()+","
                +"攻击增效"+player.getRing().getAttackPlus()+","
                +"防御增效"+player.getRing().getDefencePlus()+"。");
    }

    @Test
    public void test2() {
        ApplicationContext context=new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
        Equip lanMoRing=(Equip)context.getBean("lanMoRing2");
        Player player=(Player)context.getBean("zhangsan2");
        System.out.print("雷诗进装备：");
        player.updateEquip(lanMoRing);
        System.out.println("速度增效"+player.getRing().getSpeedPlus()+","
                +"攻击增效"+player.getRing().getAttackPlus()+","
                +"防御增效"+player.getRing().getDefencePlus()+"。");
    }
}
